package main;

import bookdata.Bookff;


import java.util.Scanner;

public class Main{
    public void showMenu() {
        System.out.println("1.图书添加");
        System.out.println("2.图书删除");
        System.out.println("3.图书查询");
        System.out.println("4.图书借阅");
        System.out.println("5.图书归还");
        System.out.println("6.借阅状态浏览");
        System.out.println("7.浏览图书列表");
        System.out.println("8.退出");
        System.out.println("请输入你的选择:");

    }
    public static void main(String args[]){
        Bookff bookff = new Bookff();
        Main main = new Main();
        bookff.read();
        main.showMenu();
        while(true) {

            Scanner scanner = new Scanner(System.in);
            int n = scanner.nextInt();
            switch (n) {
                case 1:
                    bookff.Bookadd();

                   // System.out.println("按下Enter键返回主菜单:");

                    //String i=scanner.nextLine();
                    main.showMenu();
                    bookff.save();
                    break;
                case 2:
                    bookff.Bookdel();

                    bookff.save();
                    break;
                case 3:
                    bookff.Bookfind();
                    break;
                case 4:
                    bookff.Bookborrow();
                    System.out.println("借书成功");
                    break;
                case 5:
                    bookff.Bookback();
                    System.out.println("还书成功");bookff.outDate();
                    break;
                case 6:
                    bookff.showAll();
                    break;

                case 7:
                    bookff.showBook();
                    bookff.save();
                    break;
                case 8:
                    bookff.save();

                    return;
            }
        }

    }





}

